﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using OfficeUtilHelpV2;

namespace OfficeUtilHelpV3Test
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                IDictionary<string, IList<Person>> _excelDB = new Dictionary<string, IList<Person>>();
                IList<Person> _persons = new List<Person>()
            {
                new Person{ Name="张三", Gender="男"},
                new Person{ Name="李四", Gender="男"},
                new Person{ Name="王五", Gender="男"},
            };
                _excelDB.Add("信息一", _persons);
                IList<Person> _customers = new List<Person>()
            {
                new Person{ Name="张三", Gender="女"},
                new Person{ Name="李四", Gender="女"},
                new Person{ Name="王五", Gender="女"},
            };
                _excelDB.Add("信息二", _customers);
                ExcelToolV2.ToExcel<Person>(_excelDB, @"C:\toExcel.xlsx");
                MyxlsToolV2.ToExecel<Person>(_persons, @"C:\toExcel2.xls", "Test");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message.Trim());
            }
            finally
            {
                Console.ReadLine();
            }
        }
    }
    public class Person
    {
        [DisplayName("姓名")]
        public string Name { get; set; }
        [DisplayName("性别")]
        public string Gender { get; set; }
    }
}
